package com.ds.robot.assistant.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 值班信息表
 *
 * @TableName duty_info
 */
@TableName(value = "duty_info")
@Data
@NoArgsConstructor
public class DutyInfo implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 用户ID
     */
    private String userid;

    /**
     * 值班状态 0未值班 1已值班
     */
    private Integer dutyStatus;

    /**
     * 预先提醒状态 0未提醒 1已提醒
     */
    private Integer preTipStatus;

    /**
     * 值班日期
     */
    private Date dutyDate;

    /**
     * 预提醒日期
     */
    private Date preTipDate;

    /**
     * 值班时间点 1上午 2下午
     */
    private Integer dutyPoint;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 修改时间
     */
    private Date updatedAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public DutyInfo(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DutyInfo other = (DutyInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
                && (this.getDutyStatus() == null ? other.getDutyStatus() == null : this.getDutyStatus().equals(other.getDutyStatus()))
                && (this.getDutyDate() == null ? other.getDutyDate() == null : this.getDutyDate().equals(other.getDutyDate()))
                && (this.getDutyPoint() == null ? other.getDutyPoint() == null : this.getDutyPoint().equals(other.getDutyPoint()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
                && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getDutyStatus() == null) ? 0 : getDutyStatus().hashCode());
        result = prime * result + ((getDutyDate() == null) ? 0 : getDutyDate().hashCode());
        result = prime * result + ((getDutyPoint() == null) ? 0 : getDutyPoint().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", userid=").append(userid);
        sb.append(", dutyStatus=").append(dutyStatus);
        sb.append(", dutyDate=").append(dutyDate);
        sb.append(", dutyPoint=").append(dutyPoint);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
